<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Simulation scripts</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../index.html" TARGET="_top"><img src="images/homeImg.png"></a></p>



<h1>Simulation scripts</h1>

<p>Simulation scripts are <a href="scripts.htm">embedded scripts</a> that are only executed while a simulation is running. There two types of simulation scripts: </p>

<p align=center><img src="images/simulationScripts.jpg"></p>
<p class=imageLabel>[Simulation script types]</p>
<br>

<li><strong><a href="mainScript.htm">The main script</a></strong>: by default, each <a href="scenes.htm">scene</a> has a main script that handles all the functionality (that is is charge of calling child scripts (see hereafter)). Without main script, a <a href="simulation.htm">simulation</a> cannot run. The main script can be customized, but it is preferable to do all the customization work in a child script.<br>
</li>

<li><strong><a href="childScripts.htm">Child scripts</a></strong>: each <a href="objects.htm">scene object</a> can be associated with a child script that will handle a specific part of a simulation. One particularity of them is that they can also run threaded (which is not the case with any other script types). The most common use for child scripts is to have them control a <a href="models.htm">model</a> (e.g. a robot).<br>
</li>


<p>Since child scripts  are attached to scene objects (i.e. they are <em>associated</em> scripts), they will also be duplicated during a copy-and-paste operation, which is an important feature that allows a simulation scene to be easily scalable. <em>Associated</em> scripts form the basis of CoppeliaSim's distributed control architecture.</p>



<br>
<h3 class=recommendedTopics>Recommended topics</h3>
<li><a href="mainScript.htm">The main script</a></li>
<li><a href="childScripts.htm">Child scripts</a></li>
<li><a href="customizationScripts.htm">Customization scripts</a></li>
<li><a href="accessingGeneralObjects.htm">Accessing objects programmatically</a></li>
<br>
<br>
 </tr>
</table> 
</div>  
  
  
</body>

</html>
